#include "stdafx.h"

#pragma comment(lib, "d3d9.lib") 
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "Winmm.lib")

#include <mmsystem.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <tchar.h>
#include "3D.h"


VOID CreateSphere(LPDIRECT3DDEVICE9 &g_pd3dDevice, LPD3DXMESH &sphereMesh);

VOID CreateBox(LPDIRECT3DDEVICE9 &g_pd3dDevice, LPD3DXMESH &sunMesh);

VOID ScaningMesh(LPDIRECT3DDEVICE9 &g_pd3dDevice, LPD3DXMESH &ScanMesh);

VOID CloneMeshBoxToVertexBox(LPDIRECT3DDEVICE9 &g_pd3dDevice, DWORD sVertexType, LPD3DXMESH &sourceBoxMesh, LPD3DXMESH  *cloneBoxVertex);

VOID TextureForClone(LPD3DXMESH &Mesh);

HRESULT InitGeometry(LPDIRECT3DDEVICE9 &g_pd3dDevice, LPDIRECT3DVERTEXBUFFER9 &g_pVB, LPDIRECT3DINDEXBUFFER9 &pBufferIndex);

HRESULT LoadMeshFromFile(LPDIRECT3DDEVICE9 &pd3dDevice, LPD3DXMESH &pMesh, D3DMATERIAL9 *(&pMeshMaterials), 
						 LPDIRECT3DTEXTURE9 *(&pMeshTextures), DWORD &dwNumMaterials);

HRESULT LoadMeshFromFileAlexBox(LPDIRECT3DDEVICE9 &pd3dDevice, LPD3DXMESH &g_pMesh,  D3DMATERIAL9  *(&pMeshMaterials), 
						 LPDIRECT3DTEXTURE9 *(&pMeshTextures), DWORD &dwNumMaterials);

void Scan(LPDIRECT3DDEVICE9 &g_pd3dDevice, LPD3DXMESH &cloneScan, LPDIRECT3DTEXTURE9 &scanTexture);
